<template>
    <div id="record">
        <div class="yes" v-for="x in drawList">
			<ul>
				<li class="reward">{{x.mag}}</li>
				<li class="times">{{x.time}}</li>
			</ul>
			<span class="add">{{x.integral}}</span>
		</div>
		<div class="noRecord" v-if="noRecord">
			<p style="margin-top:50%;font-size:.28rem;color:#969696;text-align:center;">暂无抽奖记录呦~</p>
		</div>
    </div>
</template>

<script>
    import config from "../config/config.js";
    import store from "../store/newStore.js";
    import share from "../share/share.js";
    import MtaH5 from 'mta-h5-analysis';
    export default{
        data(){
            return{
                drawList:[],
                noRecord:false
			}
		},
        computed:{
            ticket(){
                return this.$store.state.getTicket;
            }
        },
        methods:{
            GetDrawRecord(){
                var value=JSON.stringify({"token":localStorage.getItem('token')}),
                    key=demo(value);
                axios.post('/Home/Integral/GetDrawRecord',{
                        value:value,
                        key:key,
					    ticket:this.ticket
                },config)
                    .then(function(response) {
                        if(response.data.code==200){
                            if(response.data.data==''){
                                this.noRecord = true;
							}
                            this.drawList=response.data.data;
                            this.$store.commit('increment',response.data.ticket);
						}


                    }.bind(this))
                    .catch(function (error) {
                        console.log(error);
                    });
			}
		},
        activated(){
            share({})
			this.GetDrawRecord();
            MtaH5.init({
                "sid":'500594815',
                "cid":'500595819',
                "autoReport":0,
                "senseHash":0,
                "senseQuery":0,
                "performanceMonitor":0,
                "ignoreParams":[]
            });
            MtaH5.pgv();
        }
	}
</script>

<style>
</style>